package com.k2091.washcar.mapper;

import com.k2091.washcar.entity.Admin;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.k2091.washcar.entity.FormInline;
import com.k2091.washcar.entity.Users;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author author
 * @since 2021-06-01
 */
public interface AdminMapper extends BaseMapper<Admin> {

    List<Admin> selectAdmin(FormInline formInline);

    boolean addAdmin(Admin admin);

    int deleteAdmin(@Param("id") Long id);

    boolean upAdmin(Admin admin);

    @Update("update admin set status=#{status} where id=#{id}")
    int upStatus(@Param("id")Long id,@Param("status")int status);

    @Select("select * from users where id=#{id}")
    Admin selectById(Long id);

    @Select("select * from admin where name=#{name} and password=#{password}")
    Admin selectByNameAndPassword(@Param("name") String name,@Param("password") String password);
}
